home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / mc220.zip / COMM.H < prev    next >
C/C++ Source or Header  |  1992-02-24  |  2KB  |  71 lines

  1. /*
  2.  * MICRO-C IBM/PC Communications parameters
  3.  *
  4.  * Copyright 1990,1992 Dave Dunfield
  5.  * All rights reserved.
  6.  */
  7.  
  8. /*
  9.  * Comm port driver control flags (Cflags)
  10.  */
  11. #define    RFLOW        0x80    /* Flow control received */
  12. #define TFLOW        0x40    /* Flow control transmitted */
  13. #define    TXOFF        0x20    /* Transmit XOFF pending */
  14. #define    TXON        0x10    /* Transmit XON  pending */
  15. #define    TRANSPARENT    0x08    /* Transparent mode enable */
  16.  
  17. /*
  18.  * Common Baudrate divisors
  19.  */
  20. #define    _110        1047    /*   110 baud */
  21. #define    _300        384        /*   300 baud */
  22. #define    _1200        96        /*  1200 baud */
  23. #define    _2400        48        /*  2400 baud */
  24. #define    _4800        24        /*  4800 baud */
  25. #define    _9600        12        /*  9600 baud */
  26. #define    _19200        6        /* 19.2K baud */
  27. #define    _38400        3        /* 38.4K baud */
  28.  
  29. /*
  30.  * Mode bits: OR together one from each section
  31.  */
  32. /* Section 1 - Break control */
  33. #define    SEND_BREAK    0x40    /* Send break */
  34. /* Section 2 - Parity */
  35. #define    PAR_NO        0x00    /* No parity */
  36. #define    PAR_ODD        0x08    /* Odd parity */
  37. #define    PAR_EVEN    0x18    /* Even parity */
  38. #define    PAR_MARK    0x28    /* Mark parity */
  39. #define    PAR_SPACE    0x38    /* Space parity */
  40. /* Section 3 - Stop bits */
  41. #define    STOP_1        0x00    /* 1 stop bit */
  42. #define    STOP_2        0x04    /* 2 stop bits (1.5 if 5 bits) */
  43. /* Section 4 - Data bits */
  44. #define    DATA_5        0x00    /* 5 bits */
  45. #define    DATA_6        0x01    /* 6 bits */
  46. #define DATA_7        0x02    /* 7 bits */
  47. #define    DATA_8        0x03    /* 8 bits */
  48.  
  49. /*
  50.  * Bits in modem control register
  51.  */
  52. #define    LOOPBACK    0x10    /* Set loopback mode */
  53. #define    OUTPUT_2    0x08    /* General purpose output #2 */
  54. #define    OUTPUT_1    0x04    /* General purpose output #1 */
  55. #define    SET_RTS        0x02    /* Assert RTS output */
  56. #define    SET_DTR        0x01    /* Assert DTR output */
  57.  
  58. /*
  59.  * Bits returned by Csignals()
  60.  */
  61. #define    CD            0x80    /* Carrier detect */
  62. #define    RI            0x40    /* Ring indicator */
  63. #define    DSR            0x20    /* Data set ready */
  64. #define    CTS            0x10    /* Clear to send  */
  65. #define    END_RING    0x04    /* Ring has just ended */
  66. #define    DELTA_CD    0x08    /* CD  has changed since last read */
  67. #define    DELTA_DSR    0x02    /* DSR has changed since last read */
  68. #define DELTA_CTS    0x01    /* CTS has changed since last read */
  69.  
  70.     extern char Cflags;        /* Driver control flags */
  71.